package thread_try;

import java.util.concurrent.*;

public class MyCallable implements Callable<Integer> {
    @Override
    public Integer call() throws Exception {
        return 123;
    }

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        MyCallable m = new MyCallable();
        FutureTask<Integer> ft = new FutureTask<>(m);
        Thread thread=new Thread(ft);
        thread.start();
        System.out.println(ft.get());
    }
}

